﻿<%@ WebHandler Language="C#" Class="Ajax" %>

using System;
using System.Web;
using System.Web.Script.Serialization;
using DAL;
using BLL;

public class Ajax : IHttpHandler {
    
    public void ProcessRequest (HttpContext context) {
        var Employee = EmployeeBLL.CreateInstant().GetEmployeByID(Convert.ToInt32(context.Request["ID"]));
        JavaScriptSerializer javaScriptSerializer = new JavaScriptSerializer();
        string serEmployee = javaScriptSerializer.Serialize(Employee);
        context.Response.ContentType = "text/html";
        context.Response.Write(serEmployee);
    }
 
    public bool IsReusable {
        get {
            return false;
        }
    }

    public EmployeeDAL GetInfo(int ID)
    {
        EmployeeDAL item = new EmployeeDAL();
        item.ID = ID;
        item.Name = "Convert Json";
        return item;
    }

}